// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import './assets/style/reset.css'
import './assets/style/my-mint.scss'
import router from './router'
import 'lib-flexible'
import pub from './assets/script/pub.js'
import { Header, Toast, button } from 'mint-ui'
Vue.prototype.$pub = pub
Vue.prototype.$toast = Toast
Vue.component(Header.name, Header)
Vue.component(Toast.name, Toast)
Vue.component(button.name, button)

Vue.config.productionTip = false

router.beforeEach((to, from, next) => {
  if (to.path === '/') {
    next({ path: '/index' })
  } else {
    next()
  }
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
